import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Home from "@/views/home"
import About from "@/views/about"
import Produce from "@/views/produce"
const originalPush = Router.prototype.push

Vue.use(Router);
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect:'/about',
      children:[
        {
          path: '/about',
          name: 'About',
          component: About,
        },
        {
          path: '/produce',
          name: 'Produce',
          component: Produce,
        }
      ]
    }
  ]
})
